'use strict'

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
  const { router, controller } = app
  router.get('/api/code', controller.home.code)
  //验证码
  router.get('/', controller.home.index)
  //登录
  router.post('/api/logins', controller.login.login)
  //登录数据
  router.get('/api/loginlists', controller.login.loginlists)
  //添加乘客
  router.post('/api/addLogins', controller.login.addcar)
  //修改密码
  router.post('/api/updatapas', controller.login.updatalogin)
  //线路数据
  router.get('/api/linelists', controller.line.linelist)
  //添加线路
  router.put('/api/linelists', controller.line.lineadd)
  //删除线路
  router.delete('/api/linelists', controller.line.linedel)
  //编辑
  router.post('/api/linelists', controller.line.lineedit)
  //用户数据
  router.get('/api/loginlists', controller.home.index)
  //注册
  router.put('/api/signs', controller.login.sign)
  //车次管理数据
  router.get('/api/trains', controller.train.trainList)
  //编辑
  router.post('/api/trains', controller.train.trainEdit)
  //添加
  router.put('/api/trains', controller.train.trainAdd)
  //删除
  router.delete('/api/trains', controller.train.trainDel)
  //车站管理数据
  router.get('/api/stations', controller.station.stationList)
  //删除
  router.delete('/api/stations', controller.station.stationDel)
  //编辑
  router.post('/api/stations', controller.station.stationEdit)
  //添加
  router.put('/api/stations', controller.station.stationAdd)
  //车票管理数据
  router.get('/api/tickets', controller.ticket.TickList)
  //车票添加
  router.put('/api/tickets', controller.ticket.Tickadd)
  //删除车票
  router.delete('/api/tickets', controller.ticket.Tickdel)
  //订单管理数据
  router.get('/api/orders', controller.order.orderList)
  //删除
  router.delete('/api/orders', controller.order.orderdel)
  //详情页
  router.get('/api/details', controller.order.orderDetail)
}
